<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
    <title>后台管理 - 易买网</title>
    <link type="text/css" rel="stylesheet" href="../css/style.css"/>
    <script type="text/javascript" src="../scripts/function-manage.js"></script>
</head>

<body>
<%@ include file="/WEB-INF/manage/common/head.jsp" %>
<%@ include file="/WEB-INF/manage/common/position.jsp"%>
<div id="main" class="wrap">
    <%@ include file="/WEB-INF/manage/common/left.jsp"%>
    <div class="main">
        <h2>添加商品</h2>
        <div class="manage">
            <form action="/product/update" method="post" enctype="multipart/form-data">
                <table class="form">
                    <tr>
                        <td class="field">商品名称(*)：</td>
                        <td><input type="text" class="text" name="name"/></td>
                    </tr>
                    <tr>
                        <td class="field">描述：</td>
                        <td><input name="description" type="text" class="text" id="productDescription"/></td>
                    </tr>

                    <tr>
                        <td class="field">所属分类：</td>
                        <td><select name="pcChildId">
                            <c:forEach items="${productCategories}" var="productCategoryParent">
                                <option disabled value="${productCategoryParent.id}">${productCategoryParent.name}</option>
                                <c:forEach items="${productCategoryParent.productCategoryChildren}"
                                           var="productCategoryChildren">
                                    <option value="${productCategoryChildren.id}">
                                        ├ ${productCategoryChildren.name}</option>
                                </c:forEach>
                            </c:forEach>
                        </select></td>
                    </tr>
                    <tr>
                        <td class="field">商品价格：</td>
                        <td><input type="text" class="text tiny" name="price"/>
                            元
                        </td>
                    </tr>
                    <tr>
                        <td class="field">库存：</td>
                        <td><input type="text" class="text tiny" name="stock" id="productStock"/></td>
                    </tr>
                    <tr>
                        <td class="field">商品图片：</td>
                        <td><input type="file" name="uploadFile" id="productFileName"/></td>
                    </tr>
                    <tr>
                        <td></td>
                        <td><label class="ui-blue">
                            <input type="submit" name="submit" value="添加"/>
                        </label></td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
    <div class="clear"></div>
</div>
<%@ include file="/WEB-INF/common/footer.jsp"%>
</body>
</html>
